import pandas as pd
from pyecharts.charts import  Line,Calendar
from pyecharts import  options as opts
from pyecharts.options import InitOpts,TitleOpts,LegendOpts,ToolboxOpts,VisualMapOpts,AxisOpts

data=pd.read_excel("副本Problem_C_Data_Wordle.xlsx")
num=list(data["num"])#每日报告数量
date=list(data["date"])#日期
hard=list(data["hard"])#每日困难报告数量
month=list(data["month"])#月份
list=[list(z)for z in zip (num,date,hard,month,data)]

print(date,num,hard)

line1=Line(init_opts=InitOpts(width="1500px",height="600px",page_title="报告数量与天数关系",theme="white",))

line1.add_xaxis(date)
line1.add_yaxis(series_name="monthly report quantity",y_axis=num)

line1.set_global_opts(
    title_opts=TitleOpts("The number of reported results varies over time", pos_left="end", pos_top="1%"),
    legend_opts=LegendOpts(is_show=True),
    toolbox_opts=ToolboxOpts(is_show=True),
    visualmap_opts=VisualMapOpts(is_show=True,max_=600000),
    xaxis_opts=AxisOpts(name="date",is_inverse=True)
)

line1.set_series_opts(
    label_opts=opts.LabelOpts(is_show=False)
)


line1.render("报告结果数量与时间变化.html")
